//
//  FileUtil.m
//  HandPay
//
//  Created by xy on 10-3-24.
//  Copyright 2010 HANDPAY. All rights reserved.
//

#import "FileUtil.h"


@implementation FileUtil
+(BOOL)deletePath:(NSString *)path{
	NSFileManager *fileManager = [NSFileManager defaultManager];
	return [fileManager removeItemAtPath:path error:nil];
}
+(BOOL)existPath:(NSString *)path{
	NSFileManager *fileManager = [NSFileManager defaultManager];
	return [fileManager fileExistsAtPath:path];
}
+(BOOL)create:(NSString *)path withData:(NSData *)data{
	NSString * dir=[path stringByDeletingLastPathComponent];
	NSFileManager *fileManager = [NSFileManager defaultManager];
	if ([fileManager fileExistsAtPath:dir]==NO) {
			[fileManager createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil];
	}
	return [fileManager createFileAtPath:path contents:data attributes:nil];
}

@end
